// pages/coindynamic/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    //数据
    goldInfo:[],
  },

  onShow: function (e) {
    wx.showLoading()
    var that=this
    var user_id = getApp().globalData.userInfo.user_id
    if (user_id == null) {
      //跳转至授权登录界面
      wx.navigateTo({
        url: '../login/login',
      })
    } else {
      wx.request({ //获取金币动态
        url: 'https://www.cerywxr.com/treehole/index.php/Home/sharing/get_gold_moving',
        method: "POST", //请求方式,
        header: {
          'content-type': 'application/x-www-form-urlencoded' //POST提交数据方式
        },
        data: {
          my_id: user_id,
        },
        success(res){
          console.log(res.data.data)
          that.setData({
            goldInfo:res.data.data,
          })
          wx.hideLoading()
        }
      })
    }
  }
})